
#include <QCoreApplication>
#include <QDebug>
#include <QDir>
#include "utils.hpp"
#include "hg.hpp"



int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    if(argc == 5 || argc == 6)
        {
            if(argc == 6)
                QDir::setCurrent(argv[5]);

            hg::readHgRevisions();
            hg::writeFile(a.arguments()[4], a.arguments()[1], a.arguments()[2], a.arguments()[3]);
        }
    else
        {
            qDebug() << "Usage: version major minor patch filename [working dir]" ;
            return 1;
        }

    return a.exec();
}
